﻿using CNav.Domain;
using FluentValidation;

namespace CNav.Business.Validation
{
    public class RegisterBusinessValidation : AbstractValidator<RegisterBusiness>
    {
        public RegisterBusinessValidation()
        {
            RuleFor(b => b.BusinessName).NotEmpty().Length(4, 50).WithMessage("Business name must be at least 4 character long.");
            RuleFor(b => b.Email).EmailAddress().WithMessage("Please specify a email address.");
            RuleFor(b => b.PhoneNumber).Must(ValidatorUtils.IsPhone).WithMessage("Please specify a valid phone number.");
            RuleFor(b => b.Password).NotEmpty().Length(6, 20).WithMessage("Please specify password.");
        }
    }
}